Set message processing asynchronous #454
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When the node receive a message, it is catched by a message producer and send to a worker. All workers can handle one message at a time, so if all workers are busy, the message producer will add new messages in a queue, waiting for worker to be freed.
The problem is that all workers process the message synchronously, and so if they are on a long processing time message, message in the queue can go on timeout.
The idea here it to create a new task that will process the message and so message workers just create this task and don't wait message processing time. They are quiclky freed to get another message
Type of change
How Has This Been Tested?
Added some log in the message producer queue.
Without modification, when the receive a lot of message, there is a lot if message in the queue and some fall in timeout.
With the modification, there is only few messages waiting in the queue, and they are catched by a worker very quickly
Checklist: